<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../js/layui/css/layui.css"/>
    <script src="../js/layui/layui.js"></script>
    <script src="../js/jquery/jquery-1.9.1.js"></script>
</head>
<body>
<table id="date" lay-filter="test" ></table>
</body>
<script>
    layui.use(['table','layer','form','element'], function() {
        var table = layui.table;
        var element = layui.element;
        var layer = layui.layer;
        var form = layui.form;
        $(function () {
            var tableList = table.render({
                elem: '#date',
                fit: true,
                cellMinWidth: true, //全局定义常规单元格的最小宽度，layui 2.2.1 新增
                url: '../web/toudi', //数据接口
                type: "POST",
                loading: false,
                page: true,//开启分页
                limits: [1,5,30,40,50,60,70,80,90],//page 代表当前页码、limit 代表每页数据量
                cols: [
                    [
                        ,{field:'comname',  title: '公司名称'}
                        ,{field:'title',title: '标题'}
                        ,{field:'xinzi', title: '薪资', sort: true,templet:function (d) {
                            return d.xinzi+"k"
                        }}
                        ,{field:'zhiweitype',  title: '求职职位'}
                        ,{field:'worktype',  title: '职位要求',templet:function (d) {
                            if (d.worktype == 1){
                                return "全职"
                            }
                            if (d.worktype == 2){
                                return "兼职"
                            }
                            if (d.worktype == 3){
                                return "实习"
                            }
                        }}
                        ,{field:'miaoshu',  title: '职位描述'}
                        ,{field:'touch',  title: '联系人'}
                        ,{field:'tel', title: '联系电话'}
                        ,{field:'email', title: '联系邮箱'}
                        ,{field:'daiyuid', title: '工作要求'}
                        ,{field:'toudistatus', title: '投递状态',templet:function (d) {
                            if (d.toudistatus == 1){
                                return "未批准"
                            }
                            if (d.toudistatus == 2){
                                return "已批准"
                            }
                            if (d.toudistatus == 3){
                                return "未通过"
                            }
                        }}
                    ]
                ]
            });
        })

    })


</script>
</html>